﻿using CuaHangLego.DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CuaHangLego.Model
{
    public class HoaDonMua : HoaDon
    {
        public NhaCungCap NhaCungCap { get; set; }

        public HoaDonMua()
            : base()
        {
        }

        public HoaDonMua(int MaSo, NhaCungCap NhaCungCap, DateTime ThoiGian, IList<CTHD> DsCTHD, bool DaThanhToan)
            : base(MaSo, ThoiGian, DsCTHD, DaThanhToan)
        {
            this.NhaCungCap = NhaCungCap;
        }

        public HoaDonMua(int MaSo, NhaCungCap NhaCungCap, DateTime ThoiGian)
            : base(MaSo, ThoiGian)
        {
            this.NhaCungCap = NhaCungCap;
        }

        protected override IList<CTHD> GetCTHDs()
        {
            this.DsCTHD = CTHDMuaDA.Instance.GetAllFromHD(this.MaSo);
            return this.DsCTHD;
        }
    }
}
